home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
X-Demos and Utilities
/
(c)x2.d64
/
spritemaker.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
16KB
|
229 lines
3 GOTO 2999
5 REM******* (C) 1982 ****************
6 REM CODE3456
7 POKE46,70:CLR:PRINTCHR$(142)
10 DIMX$(553),X(25),Y(529),D(512),SF(100):PP=1465:PC=177:TC=4
20 V=53248:MC=V+39:SC=55296:SN=0:SE=V+21:POKESE,2^SN:POKEV+33,0:POKEV+32,6
30 SM=2040:MS=242*64:MH=V+SN:MP=MH:MV=MH+1+SN:GOSUB910:GOSUB960
40 GOSUB750:GOSUB630:GOSUB770:FORQ=MSTOMS+64*8:POKEQ,255:NEXT
45 REM SELECT TYPE
50 GETA$:IFA$=""THENGOSUB430
60 PRINT""LEFT$(D$,Y)LEFT$(L$,X)X$(X+24*Y);
70 IFA$=""THENY=Y+1:GOSUB380:GOTO360
80 IFA$="[145]"THENY=Y-1:GOSUB380:GOTO360
90 IFA$=""THENX=X+1:GOSUB380:GOTO360
100 IFA$="[157]"THENX=X-1:GOSUB380:GOTO360
110 IFA$="[134]"THENX$(X+24*Y)="[150] [146][158]":GOTO360
115 IFA$="[138]"THENX$(X+24*Y)="[150] [146][158]":GOTO360
120 IFA$="[135]"THENX$(X+24*Y)="+":GOTO360
125 IFA$="[139]"THENX$(X+24*Y)="+":GOTO360
130 IFA$=""THENX=1:Y=1
140 IFA$="[147]"THENGOSUB560:GOTO360
150 IFA$="[133]"THENGOSUB440:GOTO360
160 IFA$="I"THENGOSUB1040:GOTO360
170 IFA$="Y"THENGOSUB1280:GOTO360
180 IFA$="X"THENGOSUB1250:GOTO360
190 IFA$="^"THENGOSUB1310:GOTO360
200 IFA$="C"THENGOSUB1400:GOTO360
210 IFA$="A"THENQQ=0:GOSUB1460:GOTO360
220 IFA$="M"THENGOSUB1560:GOTO360
230 IFA$="[140]"THENPOKE53281,14:POKE53280,6:PRINT"GOODBYE!..":NEW
240 IFA$="V"THENGOSUB1630
250 IFA$="[137]"THENGOSUB480:GOTO360
260 IFA$="H"THENGOSUB1700:GOTO360
270 IFA$="U"THENGOSUB1680:GOTO360
280 IFA$="[136]"THENGOSUB530:GOTO360
290 IFA$="<"THENGOSUB810:GOTO360
300 IFA$=">"THENGOSUB860
309 IFA$="T"THENGOSUB2000:GOTO360
310 IFA$="S"THENGOSUB1720:GOTO360
320 IFA$="L"THENGOSUB1820:GOTO360
330 IFA$="E"THENB$=A$:GOSUB560:GOTO360
340 IFA$="D"THENGOSUB1890:GOTO360
350 IFA$="F"THENGOSUB1940:GOTO360
360 PRINT""LEFT$(D$,Y)LEFT$(L$,X)C$
370 GOTO50
380 IFX>24THENX=1:RETURN
390 IFX<1THENX=24:RETURN
400 IFY>21THENY=1:RETURN
410 IFY<1THENY=21:RETURN
420 RETURN
430 PRINT""LEFT$(D$,Y)LEFT$(L$,X)C$:RETURN
440 PRINT"[159]:530":D=0:C=7:FORQ=25TO529:IFX$(Q)="+"THEN460
450 D=D+2^C
460 C=C-1:IFC<0THENC=7:POKEMS,D:MS=MS+1:D=0
470 PRINT""Q:NEXT:MS=242*64+(64*SN):PRINT" [158]":RETURN
480 PRINT":530":FORQ=1TO529:IFX$(Q)="+"THENX$(Q)="[150] [146][158]":GOTO500
490 X$(Q)="+"
500 PRINT""Q:NEXT
510 PRINT"[147]":FORQ=1TO21:PRINT"";:FORZ=1TO24:PRINTX$(Z+24*Q);:NEXT:PRINT
520 NEXT:GOSUB630:RETURN
530 PRINT""D$"[158]COLOR? 0 TO 15";:INPUTCO$:IFVAL(CO$)<0ORVAL(CO$)>15THEN530
540 CO=VAL(CO$):POKEMC+SN,CO:IFSN=0THENTC=PEEK(MC)
550 PRINT""D$" ":RETURN
560 PRINT""D$"[158]CONTINUE Y/N?[158]"
570 GETA$:IFA$=""THENFORQ=1TO100:NEXT:PRINT""D$"CONTINUE Y/N?[146]";
580 IFA$="N"THENPRINT""D$" ":RETURN
590 IFA$="Y"ANDB$<>"E"THEN620
600 IFB$="E"ANDA$="Y"THEN1930
610 FORQ=1TO100:NEXT:GOTO560
620 GOSUB910:GOSUB750:GOSUB630:GOSUB770:RETURN
625 REM ********** SCREEN DISPLAY******
630 D$="":L$="":C$="[158] [146][158]"
640 X=1:Y=1
650 PRINTCHR$(14):PRINT""
660 PRINT"[158]F3[146] [159]=[212]URN"SPC(24)"[145][158]F1[146] [159]= [213]P-";
670 PRINT" ON"SPC(30)"[145]DATE "
680 PRINT"[158]F5[146] [159]=[212]URN"SPC(24)"[158]F7[146] [159]=[195]OLO";
690 PRINT" OFF"
700 PRINT" "SPC(25)"[158]F2[146] [159]=[210]EV."
710 PRINT"(C) 1982[146]"SPC(25)"[159]SPRITE";
720 PRINT" [211]UPER ":POKEPP,PC
730 PRINT"[211]PRITE"SPC(26)"[158]F8[146] [159]=[197]ND":PRINT"C[146]"
740 PRINT""SPC(33)"[155][158]I[146] [159]=[200]ELP [154]":RETURN
750 PRINT"[147][158]":FORY=1TO21:PRINT"";:FORX=1TO24:PRINT"+";:NEXT:PRINT:NEXT
760 RETURN
770 PRINT"[159][159]:530":FORZ=1TO528:X$(Z)="+":PRINT""Z:NEXT:X=1:Y=1
780 PRINT" [158]":RETURN
790 PRINT"[147][158]":FORQ=1TO21:PRINT"";:FORZ=1TO24:PRINTX$(Z+24*Q);:NEXT:PRINT
800 NEXT:RETURN
810 POKEMC,TC:IFFL=1THENGOSUB910:FL=0
820 SN=SN-1:IFSN<=0THENSN=0:POKEPP,32:PC=177:PP=1465:POKEPP,PC
830 MS=(242*64)+(SN*64):POKESM-SN,242-SN
840 ONSNGOSUB970,980,990,1000,1010,1020,1030:RETURN
850 RETURN
860 POKEMC,TC:IFFL=1THENGOSUB910:FL=0
870 SN=SN+1:IFSN>7THENSN=7:RETURN
880 MS=(242*64)+(SN*64):POKESM+SN,242+SN
890 ONSNGOSUB970,980,990,1000,1010,1020,1030:RETURN
900 POKEPP,32:PC=184:POKE1822,PC:PP=1822:RETURN
910 MP=V:POKEV+23,0:POKEV+29,0:POKEMP,24:POKEMP+1,150:POKEMP+2,52:POKEMP+3,150
920 POKEMP+4,24:POKEMP+5,175:POKEMP+6,52:POKEMP+7,175
930 POKEMP+8,30:POKEMP+9,150:POKEMP+10,60:POKEMP+11,150
940 POKEMP+12,30:POKEMP+13,175:POKEMP+14,60:POKEMP+15,175:POKEV+16,240
950 FORQ=0TO7:POKESM+Q,242+Q:NEXT:POKESE,255:RETURN
960 FORQ=0TO7:POKESM+Q,242+Q:POKEMC+Q,4:NEXT:POKESE,255:RETURN
970 POKEPP,32:PC=178:POKE1469,PC:PP=1469:RETURN
980 POKEPP,32:PC=179:POKE1785,PC:PP=1785:RETURN
990 POKEPP,32:PC=180:POKE1789,PC:PP=1789:RETURN
1000 POKEPP,32:PC=181:POKE1498,PC:PP=1498:RETURN
1010 POKEPP,32:PC=182:POKE1501,PC:PP=1501:RETURN
1020 POKEPP,32:PC=183:POKE1818,PC:PP=1818:RETURN
1030 POKEPP,32:PC=184:POKE1822,PC:PP=1822:RETURN
1035 REM HELP MENU DISPLAY UTS
1040 POKESE,0:POKEV+32,6:PRINTCHR$(14)
1050 PRINT"[147]"TAB(16)" HELP ":PRINT" [158]<[146] [159][193]ND [158]>[146] [159][211]ELECT SPRITE.
1060 [153]"SYS F1WAIT OPEN(null)PDATE SPRITE."
1070 [153]"SYS ^WAIT OPENSTR$ISPLAY DATA VALUES OF WINDOW."
1080 [153]"SYS MWAIT OPEN(null)OVE SPRITE INTO WINDOW."
1100 [153]"SYS CWAIT OPENLENOPY ONE SPRITE INTO ANOTHER."
1110 [153]"SYS SWAIT OPEN(null)AVE SPRITE TO TAPE OR DISK."
1120 [153]"SYS EWAIT OPENVALRASE SELECTED SPRITE."
1130 [153]"SYS FWAIT OPEN(null)EV. SELECTED SPRITE."
1140 [153]"SYS DWAIT OPENSTR$ISPLAY DATA VALUES OF SPRITE."
1150 [153]"SYS LWAIT OPEN(null)OAD SPRITE FROM TAPE OR DISK."
1160 [153]"SYS XWAIT OPENVALXPAND/SHRINK SPRITE IN X-AXIS."
1170 [153]"SYS TWAIT OPEN(null)URN WINDOW SIDEWAYS."
1180 [153]"SYS UWAIT OPEN(null)URN WINDOW UPSIDE DOWN."
1181 [153]"SYS YWAIT OPENVALXPAND/SHRINK SPRITE IN Y-AXIS."
1190 [153]"SYS HWAIT OPENLENOPY TOP WINDOW-HALF HORIZONTALLY."
1200 [153]"SYS VWAIT OPENLENOPY RIGHT WINDOW-HALF VERTICALLY."
1210 [153]"SYS F8WAIT OPENVALNDS THE PROGRAM."
1220 [153]"SYSLEFT$IT ANY KEYSYS"
1230 [161]A$:[139]A$[178]""[167]1230
1240 [141]510:[151]SE,255:[153][199](14):[151]V[170]32,6:[142]
1250 FL[178]1:[151]SM,242[170]SN:MH[178]V:MV[178]MH[170]1:[151]MV,200:[151]MH,26
1260 [151]MC,[194](MC[170]SN):[139][194](V[170]29)[179][177]0[167][151]V[170]29,0:[142]
1270 [151]V[170]29,1:[142]
1280 FL[178]1:[151]SM,242[170]SN:MH[178]V:MV[178]MH[170]1:[151]MV,200:[151]MH,26
1290 [151]MC,[194](MC[170]SN):[139][194](V[170]23)[179][177]0[167][151]V[170]23,0:[142]
1300 [151]V[170]23,1:[142]
1310 [153]"LOADSTR$ATA VALUES OF WINDOW ARE:":D[178]0:Z[178]0:C$[178]"":[151]SE,0
1320 C[178]7:[129]Q[178]25[164]529:[139]X$(Q)[178]"+"[167]1340
1330 D[178]D[170]2[174]C
1340 C[178]C[171]1:[139]C[179]0[167]C[178]7:[153]C$""D,:D[178]0:Z[178]Z[170]1:[139]Z[178]4[167]C$[178]"SYS"
1350 [139]Z[178]8[167]Z[178]0:C$[178]""
1360 [130]
1370 [153]"":[153][163]13)"SYSLEFT$RIGHT$(null)CLOSEATN(null)(null)CLOSE(null)VAL(null)SYS"
1380 [161]A$:[139]A$[178]""[167]1380
1390 [151]SE,255:[141]790:[141]630:[142]
1400 [153]""D$;:[133]"SYSCOPY SPRITE NO.0CMDCMDCMD";FS:[139]FS[179]1[176]FS[177]8[167]1450
1410 [153]""D$;:[133]"SYSINTO SPRITE NO. ";SS:[139]SS[179]1[176]SS[177]8[176]SS[178]FS[167]1450
1420 SS[178]SS[171]1:FS[178]FS[171]1
1430 WW[178]64[172]242[170]64[172]FS:WV[178]64[172]242[170]64[172]SS:[129]Q[178]0[164]63:[151]WV,[194](WW):WW[178]WW[170]1:WV[178]WV[170]1
1440 [130]
1450 [153]""D$" SYS":[142]
1460 [153]""D$;:[133]"PRINTSYSSPRITE NO.0CMDCMDCMD";SF(QQ)
1470 [139]SF(QQ)[178]0[167]1490
1480 [139]SF(QQ)[179][177]0[175]SF(QQ)[179]9[167]QQ[178]QQ[170]1:[137]1460
1490 MH[178]V:MV[178]MH[170]1:[151]MV,200:[153]""D$"SYSANIMATEWAIT CONTSYSQWAIT OPENTO QUIT SYS"
1500 [129]Q[178]0[164]QQ[171]1:[151]SM,242[170]SF(Q)[171]1:[151]V[170]39,[194](V[170]39[170]Q):[139]Q[178]0[167][151]V[170]39,TC
1510 [161]A$:[139]A$[178]""[167]1510
1520 [139]A$[178]"Q"[167]1540
1530 [130]:[137]1500
1540 [139]A$[178]"Q"[167][153]""D$" "
1550 [141]910:[151]V[170]39,TC:[142]
1560 [153]":64":MS[178]64[172]242[170]64[172]SN:Z[178]25:[129]Q[178]0[164]63:D[178][194](MS[170]Q)
1570 [139]D[178]0[167][129]W[178]0[164]7:X$(Z)[178]"+":Z[178]Z[170]1:[130]:[137]1610
1580 [129]QQ[178]7[164]0[169][171]1:M[178]D[171]2[174]QQ[175]2[174]QQ:[139]M[178]0[167]X$(Z)[178]"DEF WAITSYS":[137]1600
1590 X$(Z)[178]"+"
1600 Z[178]Z[170]1:[130]
1610 [153]""Q:[130]:[153]"SYS"
1620 [141]790:[141]630:[142]
1630 Q[178]1:QQ[178]24:[153]":528WAIT"
1640 [129]X[178]0[164]12:X$(Q)[178]X$(QQ[171]X):Q[178]Q[170]1:[130]:QQ[178]QQ[170]24:Q[178]QQ[171]23
1650 [139]QQ[177]528[167]1670
1660 [153]"";QQ:[137]1640
1670 [153]"SYS":[141]790:[141]630:[142]
1680 [153]":276WAIT":[129]Q[178]1[164]276:A$[178]X$(Q):B$[178]X$(553[171]Q):X$(553[171]Q)[178]A$
1690 X$(Q)[178]B$:[153]""Q:[130]:[153]"SYS":[141]790:[141]630:[142]
1700 [153]":240":[129]Q[178]24[164]240[169]24:[129]QQ[178]1[164]24:X$(528[171]Q[170]QQ)[178]X$(Q[170]QQ)
1710 [153]"";Q:[130]:[130]:[153]"SYS":[141]790:[141]630:[142]
1720 [153]""D$"SYS(null)AVE TO SYS(null)WAITOPENAPE OR SYSSTR$WAITOPENISK?"
1730 [161]A$:[139]A$[178]""[167]1730
1740 [139]A$[179][177]"T"[175]A$[179][177]"D"[167][141]550:[142]
1750 [133]"LOADSYSASCILENAME";F$
1760 [133]"LOADSYS(null)AVE FROM SPRITE NO";FS:[139]FS[179]1[176]FS[177]8[167][141]790:[141]630:[142]
1770 [133]"LOADSYS(null)O SPRITE NO";LS:[139]LS[177]8[176]LS[179]0[176]LS[179]SF[167][141]790:[141]630:[142]
1780 [151]SE,0:[153]"LOAD":FS[178]FS[171]1:LS[178]LS[171]1:[139]A$[178]"T"[167][159]3,1,2,F$:[137]1800
1790 [159]3,8,3,"0:"[170]F$[170]",S,W"
1800 [152]3,LS:[129]Q[178]MS[170]FS[172]64[164]MS[170]LS[172]64[170]64:A[178][194](Q):[152]3,A:[130]
1810 [160]3:[151]SE,255:[141]790:[141]630:[142]
1820 [153]""D$"SYS(null)OAD FROM SYS(null)WAITOPENAPE OR SYSSTR$WAITOPENISK?"
1830 [161]A$:[139]A$[178]""[167]1830
1840 [139]A$[179][177]"T"[175]A$[179][177]"D"[167][141]550:[142]
1850 [151]SE,0:MS[178]242[172]64:[133]"LOADSYSASCILENAME";F$:[139]A$[178]"T"[167][159]3,1,0,F$:[137]1870
1860 [159]3,8,3,"0:"[170]F$[170]",S,R"
1870 [132]3,A:[129]X[178]0[164]A[172]64[170]64:[132]3,B:[151]MS,B:MS[178]MS[170]1:[130]:[160]3:[151]SE,255:[141]790
1880 [141]630:[141]910:[142]
1890 [153]"LOADSTR$ATA VALUES FOR SPRITE #"SN[170]1"CMD ARE:":D[178]0:Z[178]0:C$[178]"":[151]SE,0
1900 [129]Q[178]MS[164]MS[170]62:[153]""C$[194](Q),:Z[178]Z[170]1:[139]Z[178]4[167]C$[178]"SYS"
1910 [139]Z[178]8[167]C$[178]"":Z[178]0
1920 [130]:[153]"ONON":[137]1370
1930 [129]Q[178]MS[164]MS[170]63:[151]Q,255:[130]:B$[178]"":[141]550:[142]
1940 [129]Q[178]MS[164]MS[170]63:A[178][194](Q):[151]Q,255[171]A:[130]:[142]
2000 Q[178]1:QQ[178]24:[153]":528WAIT"
2010 [129]X[178]0[164]12:A$[178]X$(Q):B$[178]X$(QQ[171]X):X$(Q)[178]B$:X$(QQ[171]X)[178]A$:Q[178]Q[170]1
2015 [130]:QQ[178]QQ[170]24:Q[178]QQ[171]23
2020 [139]QQ[177]528[167]2040
2030 [153]"";QQ:[137]2010
2040 [153]"SYS":[141]790:[141]630:[142]
2990 [143] UTS DISPLAY
2999 [151]53281,0:[151]53280,6:[153][199](14)
3000 [153]"LOAD WAITSYS"
3005 [153]" WAIT WAIT"
3010 [153]" WAIT WAIT"
3015 [153]" WAIT (null)UPER (null)PRITE WAIT"
3016 [153]" WAIT WAIT"
3017 [153]" WAIT WAIT"
3020 [153]" WAIT BY (null)YNN (null)ILSON WAIT"
3025 [153]" WAIT WAIT"
3026 [153]" WAIT WAIT"
3030 [153]" WAIT 1982WAIT WAIT"
3035 [153]" WAIT WAIT"
3050 [153]" WAIT WAIT"
3065 [153]" WAIT"
3070 [153]" SYS(null)(null)VAL(null)(null)CLOSEATNCLOSE(null)VAL(null)WAIT"
3080 [161]Z$:[139]Z$[178]""[167]3080
3090 [139]Z$[178][179][177]""[167] [137]10